/**
 * 
 */
package t4j.exceptions;

/**
 * @author sz
 *
 * create time：2012-11-16
 */
public class Switch {

	private boolean state = false;
	
	public boolean read(){ return state;}
	
	public void on(){ state = true; System.out.println(this);}
	
	public void off(){ state = false; System.out.println(this);}
	
	public String toString(){
		return state ? "on" : "off";
	}
}
